package algos;

import java.util.Arrays;

/**
 *
 * @author Ahmad
 */
public class Matching {

    public static int[] match(float[][] g) {
        int[][] a = new HungarianAlgorithm().computeAssignments(g);
        int[] res = new int[g.length];
        Arrays.fill(res, -1);
        for (int i = 0; i < g.length; i++)
            if (a[i][0] != -1)
                res[a[i][0]] = a[i][1];
        return res;
    }
}
